<template>
	<view class="">
		<view class="zui-address" v-if="!is_null">
			<view class="icon" v-if="icon">
				<u-icon name="map-fill" color="#fff" size="16"></u-icon>
			</view>
			<zui-col>
				<view class="top">
					<view class="site_name">{{name}}</view>
					<view class="site_phone">{{phone}}</view>
				</view>
				<view class="bottom">
					<view class="site_text u-line-2">
						{{address}}
					</view>
				</view>
			</zui-col>
			<view class="arrow" v-if="!is_opt">
				<u-icon name="arrow-right" :color="right" size="16"></u-icon>
			</view>
			<view class="arrow" v-if="is_opt">
				<slot></slot>
			</view>
		</view>
		<view class="zui-address" v-else-if="is_null">
			<view class="icon" v-if="icon">
				<u-icon name="map-fill" color="#fff" size="16"></u-icon>
			</view>
			<zui-col>
				<view class="top">
					<view class="site_name">暂无地址</view>
					<!-- <view class="site_phone">暂无地址</view> -->
				</view>
				<view class="bottom">
					<view class="site_text u-line-2">
						您可用点击我去添加您的收货地址
					</view>
				</view>
			</zui-col>
			<view class="arrow">
				<u-icon name="arrow-right" :color="right" size="16"></u-icon>
			</view>
		</view>
	</view>

</template>

<script>
	export default {
		name: "flat_box",
		props: {
			icon: {
				type: Boolean,
				default: true
			},
			right: {
				type: String,
				default: '#fff'
			},
			name: {
				type: String,
			},
			phone: {
				type: String,
			},
			address: {
				type: String,
			},
			is_null: {
				type: Boolean,
			},
			is_opt: {
				type: Boolean,
			},
		},
		data() {
			return {


			};
		}
	}
</script>

<style lang="scss" scoped>
	.zui-address {
		width: 100%;
		display: flex;
		justify-content: space-between;
		align-items: center;
		box-sizing: border-box;

		.icon {
			width: 52rpx;
			height: 52rpx;
			background: #AA334F;
			border-radius: 50%;
			display: flex;
			justify-content: center;
			align-items: center;
			flex-shrink: 0;
		}
		
		.top {
			display: flex;
			justify-content: flex-start;
			align-items: center;
			margin-bottom: 20rpx;

			/* //名字 */
			.site_name {
				font-size: 26rpx;
				color: #272727;
				margin-right: 20rpx;
			}

			/* //电话 */
			.site_phone {
				font-size: 26rpx;
				color: #272727;
				margin-right: 20rpx;
			}

		}

		/* //单个地址左侧地址详细 */
		.bottom {
			.site_text {
				width: 512rpx;
				color: #272727;
			}
		}


	}
</style>
